<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/hadmin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/hadmin/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="/hadmin/css/animate.css" rel="stylesheet">
    <link href="/hadmin/css/style.css?v=4.1.0" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown" id="login">
        <div>
            <div>

                <h1 class="logo-name">h</h1>

            </div>
            <h3>欢迎使用 人事管理系统</h3>

            <form class="m-t" role="form" onsubmit="return false;">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="用户名" required="" v-model="uname">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" required="" v-model="password">
                </div>
                <button type="submit" @click="login" class="btn btn-primary block full-width m-b">登 录</button>

            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="/hadmin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/hadmin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/hadmin/js/plugins/toastr/toastr.min.js"></script>
    <script src="/vue/vue.js"></script>
    <script src="/vue/axios.min.js"></script>
    <script src="/vue/axios-tools.js"></script>

    
    

</body>

<script>
    $(function () {
        var loginapp = new Vue({
            el: '#login',
            data: {
                uname: '',
                password: ''
            },
            methods: {
                login(){
                    if(this.uname=='' || this.password == ''){
                        return false;
                    }

                    axiosconfig({
                        url: '/login',
                        method: 'get',
                        params: {
                            uname: this.uname,
                            password: this.password
                        },
                        succ: function (back) {
                            console.info(back)
                            location.href = "index.html"
                        }
                    })
                }
            }
        })
    })
</script>

</html>
